import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        // 默认的登录注册页面路由
        path: '/',
        name: 'mimLogin',
        component: () => import('../views/MimLogin/MimLogin.vue')
    },
    {
        // 忘记密码页面路由
        path: '/forgetPassword',
        name: 'ForgetPassword',
        component: () => import('../views/ForgetPassword/ForgetPassword.vue')
    },
    {
        // 主页路由
        path: '/home',
        name: 'Home',
        component: () => import('../views/Home/Home.vue'),
        // 子路由
        children: [
            {
                // 消息路由
                path: '/message',
                name: 'Message',
                component: () => import('../views/Message/Message.vue')
            },
            {
                // 通讯录路由
                path: '/phoneBook',
                name: 'PhoneBook',
                component: () => import('../views/PhoneBook/PhoneBook.vue')
            },
            {
                // 设置路由
                path: '/setting',
                name: 'Setting',
                component: () => import('../views/Setting/Setting.vue')
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router